package org.example.back.service.user;

import org.example.back.entity.user.UserProfile;
import org.example.back.mapper.user.UserProfileMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserProfileService {

    @Autowired
    private UserProfileMapper userProfileMapper;

    // 保存用户资料
    public void saveUserProfile(UserProfile userProfile) {
        userProfileMapper.insertUserProfile(userProfile);
    }

    // 根据 user_id 查询用户资料
    public UserProfile getUserProfileByUserId(Integer userId) {
        return userProfileMapper.findUserProfileByUserId(userId);
    }
    
    //修改用户资料
    public void updateUserProfile(UserProfile userProfile) {
    userProfileMapper.updateUserProfile(userProfile);
    }
}
